<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE>
<html>
<head>
<meta  charset="utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
      <form action="updatepwd.user" method="post">
           <input type="hidden" name="old" value="${oldpwd }">
         输入新密码：<input type="password" name="upwd" id="upwd">
         再次新密码：<input type="password" name="upwd2" id="upwd2">
         <input type="submit" value="提交" onclick="return check();">
      </form>
      
      <script type="text/javascript">
          function check(){
        	  var upwd=$("#upwd").val();
        	  var upwd2=$("#upwd2").val();
        	  
        	  if(upwd.length==0){
        		   alert("输入新密码不能为空");
        		  return false;
        	  }
        	  if(upwd2.length==0){
       		   alert("再次新密码不能为空");
       		  return false;
       	  }
        	  
        	  if(upwd!=upwd2){
        		  alert("两次密码输入不一样");
        		  return false;
        	  }
        	  
        	  return true;
          }
      </script>
</body>
</html>